#ifndef GRAPHDISPLAY
#define GRAPHDISPLAY
#using <mscorlib.dll>
#include <vcclr.h>
#include "humanplayer.h"
#include <list>
#include <string>
#include "IA.h"
#include "pairIntString.h"


namespace GuiVersion{
	ref class Form1;
}


namespace View{
	class GraphicalDisplay :
		public HumanPlayer
	{

	public:
		int currentPlayerToPlay;
		virtual void refreshAll();
		/**
		getter
		@return a pointer to the controller
		*/
		Controller* getMyController();

		/**
		Ask the admin class to create a new player with the controller
		@param name The name of the new player
		@param pc the HumanPlayer which will control it
		*/
		void requestNewPlayer(std::string name,HumanPlayer* hp);
		/**
		Ask the admin class to create a new IA with the controller
		@param name The name of the new IA
		@param intArt the IA which will control it ( if NULL then a new one will be created
		*/
		void requestNewIA(std::string name,IA* intArt=NULL);

		/**
		ask the admin class to start the game 
		*/
		void startGame();
		/**
		@inherited
		*/
		void addControledColor(int idPlayer);
		/**
		@inherited
		*/
		void gameRefreshed();
		/**
		@inherited
		*/
		void toPlay(int idPlayer);


		/**
		@inherited
		*/
		virtual void playerStateChanged();


		/**
		@inherited
		*/
		virtual void gameStatusChanged();

		/**
		@inherited
		*/
		virtual void endGame(int idPlayer);

		GraphicalDisplay(GuiVersion::Form1^ f);
		~GraphicalDisplay(void);
	protected:
		gcroot<GuiVersion::Form1^> myForm;
		list<int> playerControlled;
		int playerToPlay;
	

	public:
		void drawFreeTile(System::Windows::Forms::PaintEventArgs^  e);
		void drawTile(int i,System::Windows::Forms::PaintEventArgs^  e);

		void drawTarget(System::Windows::Forms::PaintEventArgs^  e);
	};
}
#else 
namespace View{
	class GraphicalDisplay;
}

#endif 